import { Option } from '@/types/common';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';

// 创建 axios 实例
const service = axios.create({
	baseURL: "/",
	timeout: 50000,
	withCredentials: true, // send cookies when cross-domain requests
	//headers: { 'Content-Type': 'application/json;charset=utf-8' }
}); 

/**
 * 获取菜单下拉树形列表
 */
export function listMenus(): AxiosPromise<any> {
  return service.request({
    url: '/codegen/menulist.html',
    method: 'get',
  }); 
}


/**
 * 保存菜单
 *
 * @param data
 */
export function saveMenu(data: any) {
  return service.request({
    url: '/codegen/menusave.html',
    method: 'post',
    data: data,
  });
}

